namespace Profit.Converters
{
    using System;
    using System.Globalization;
    using System.Windows.Data;
    using Core.Contracts.Enums;

    [ValueConversion(typeof(ModuleGroupsEnum), typeof(string))]
    public class ModuleGroupsToLabelConverter : IValueConverter
    {
        /// <summary>
        /// Converts a value. 
        /// </summary>
        /// <returns>
        /// A converted value. If the method returns null, the valid null value is used.
        /// </returns>
        /// <param name="value">The value produced by the binding source.</param><param name="targetType">The type of the binding target property.</param><param name="parameter">The converter parameter to use.</param><param name="culture">The culture to use in the converter.</param>
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is ModuleGroupsEnum)
            switch ((ModuleGroupsEnum)value)
            {
                case ModuleGroupsEnum.AccumulatorRechargers :
                    return "Accumulator rechargers";
                case ModuleGroupsEnum.ArmorHardeners:
                    return "Armor hardeners";
                case ModuleGroupsEnum.ArmorPlates:
                    return "Armor plates";
                case ModuleGroupsEnum.ArmorRepairers:
                    return "Armor repairers";
                case ModuleGroupsEnum.ArmorRepairersTunings:
                    return "Armor repairer tunings";
                case ModuleGroupsEnum.AuxiliaryAccumulators:
                    return "Auxiliary accumulators";
                case ModuleGroupsEnum.CargoScanners:
                    return "Cargo scanners";
                case ModuleGroupsEnum.ChassisScanners:
                    return "Chassis scanners";
                case ModuleGroupsEnum.ElectronicModules:
                    return "Electronic modules";
                case ModuleGroupsEnum.ElectronicWarfareModules:
                    return "Electronic warfare modules";
                case ModuleGroupsEnum.EnergyDrainers:
                    return "Energy drainers";
                case ModuleGroupsEnum.EnergyInjectors:
                    return "Energy injectors";
                case ModuleGroupsEnum.EnergyNeutralizers:
                    return "Energy neutralizers";
                case ModuleGroupsEnum.EnergyTransferers:
                    return "Energy transferers";
                case ModuleGroupsEnum.EvasiveModules:
                    return "Evasive modules";
                case ModuleGroupsEnum.EngineeringTunings:
                    return "Engineering tunings";
                case ModuleGroupsEnum.ReactorSealings:
                    return "Reactor sealings";
                case ModuleGroupsEnum.HarvesterModules:
                    return "Harvester modules";
                case ModuleGroupsEnum.IndustrialTunings:
                    return "Industrial tunings";
                case ModuleGroupsEnum.LightweightFrames:
                    return "Lightweight frames";
                case ModuleGroupsEnum.MagneticWeapons:
                    return "Magnetic weapons";
                case ModuleGroupsEnum.MinerModules:
                    return "Miner modules";
                case ModuleGroupsEnum.ConstructionModules:
                    return "Construction modules";
                case ModuleGroupsEnum.TerraformingModules:
                    return "Terraforming modules";
                case ModuleGroupsEnum.MissileLaunchers:
                    return "Missile launchers";
                case ModuleGroupsEnum.NexusModules:
                    return "NEXUS modules";
                case ModuleGroupsEnum.RangeExtenders:
                    return "Range extenders";
                case ModuleGroupsEnum.RemoteArmorRepairers:
                    return "Remote armor repairers";
                case ModuleGroupsEnum.RemoteSensorAmplifiers:
                    return "Remote sensor amplifiers";
                case ModuleGroupsEnum.SapHackingModules:
                    return "SAP modules";
                case ModuleGroupsEnum.SensorAmplifiers:
                    return "Sensor amplifiers";
                case ModuleGroupsEnum.SensorSuppressors:
                    return "Sensor suppressors";
                case ModuleGroupsEnum.ShieldGenerators:
                    return "Shield generators";
                case ModuleGroupsEnum.ShieldHardeners:
                    return "Shield hardeners";
                case ModuleGroupsEnum.SignalDetectors:
                    return "Signal detectors";
                case ModuleGroupsEnum.SignalMarkers:
                    return "Signal markers";
                case ModuleGroupsEnum.SignalMaskers:
                    return "Signal maskers";
                case ModuleGroupsEnum.WeaponTunings:
                    return "Weapon tunings";
                case ModuleGroupsEnum.InterferenceModules :
                    return "Interference Modules";
                case ModuleGroupsEnum.ECMTunings:
                    return "ECM Tunings";
                case ModuleGroupsEnum.SensorSuppressorTunings:
                    return "Sensor Suppressor Tunings";
                case ModuleGroupsEnum.NexusModuleArmor :
                    return "Armor";
                case ModuleGroupsEnum.NexusModuleAssault :
                    return "Assault";
                case ModuleGroupsEnum.NexusModuleCriticalHit :
                    return "Critical hit";
                case ModuleGroupsEnum.NexusModuleEvasive :
                    return "Evasive";
                case ModuleGroupsEnum.NexusModuleEw:
                    return "EW";
                case ModuleGroupsEnum.NexusModuleFarlock:
                    return "Farlock";
                case ModuleGroupsEnum.NexusModuleFastExtractor :
                    return "Fast extractor";
                case ModuleGroupsEnum.NexusModuleIndustrial :
                    return "Industrial";
                case ModuleGroupsEnum.NexusModuleLockBooster :
                    return "Lock booster";
                case ModuleGroupsEnum.NexusModuleRecharger :
                    return "Recharger";
                case ModuleGroupsEnum.NexusModuleRepairer :
                    return "Repairer";
                case ModuleGroupsEnum.NexusModuleShield :
                    return "Shield";
                case ModuleGroupsEnum.NexusModuleVelocity :
                    return "Velocity";
                case ModuleGroupsEnum.TargetMarkers:
                    return "Target markers";

                default: return value.ToString();
            }
            return null;
        }

        /// <summary>
        /// Converts a value. 
        /// </summary>
        /// <returns>
        /// A converted value. If the method returns null, the valid null value is used.
        /// </returns>
        /// <param name="value">The value that is produced by the binding target.</param><param name="targetType">The type to convert to.</param><param name="parameter">The converter parameter to use.</param><param name="culture">The culture to use in the converter.</param>
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}